/*colddays.c -- 找出0℃以下的天数占总天数*/

#include "stdio.h"

int main(void){

    const int FREEZING = 0;

    float temp;
    int cold_days = 0;
    int all_days = 0;

    printf("输入摄氏度:");
    while(scanf("%f",&temp) == 1){
        all_days++;
        if(temp < FREEZING)
            cold_days++;
    }
    if(all_days != 0)
        printf("0下的天数:%d总共天数:%d,0下天数所占比例:%1.3f",cold_days,all_days,(float)cold_days/all_days);
    if(all_days == 0){
        printf("还没有一天,你在想什么?");
    }
    
}